home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE17 / CLINIC / LISTING3.PAS next >
Encoding:
Pascal/Delphi Source File  |  1996-12-19  |  374 b   |  15 lines

  1. procedure TForm1.FormCreate(Sender: TObject);
  2. var
  3.   Index: Integer;
  4. const
  5.   TwoDigitYear = 'yy';
  6.   FourDigitYear = TwoDigitYear + 'y';
  7. begin
  8.   if Pos(FourDigitYear, ShortDateFormat) = 0 then begin
  9.     Index := Pos(TwoDigitYear, ShortDateFormat);
  10.     if Index <> 0 then
  11.       { Insert an extra letter 'y' }
  12.       Insert('y', ShortDateFormat, Index)
  13.   end
  14. end;
  15.